{extend name="public/base" /}

{block name="title"}<title>{$Think.lang.list}</title>{/block}

{block name="pjax_container"}
<section class="content-header">
    <h1>文章分类</h1>
    <ol class="breadcrumb">
        <li class="active"><i class="fa fa-dashboard"></i> 文章分类</li>
    </ol>
</section>
<section class="content">
    <div class="row">
        <div class="col-md-12">
            <div class="box box-primary">
                <div class="box-header with-border">
                    <h3 class="box-title"></h3>
                    <div class="pull-left">
                        {:authAction(CONTROLLER_NAME.'/create', 'create')}
                    </div>
                </div>
                <div class="box-body table-responsive">
                    <table class="table table-bordered table-hover">
                        <tr>
                            <th>{$Think.lang.id}</th>
                            <th>{$Think.lang.headline}</th>
                            <th>{$Think.lang.title}</th>
                            <th>{$Think.lang.content}</th>
                            <th>{$Think.lang.pic}</th>
                            <th>{$Think.lang.production}</th>
                            <th>{$Think.lang.link}</th>
                            <th>{$Think.lang.status}</th>
                            <th>{$Think.lang.sorts}</th>
                            <th>{$Think.lang.zxm}</th>
                            <th>{$Think.lang.create_time}</th>
                            <th>{$Think.lang.update_time}</th>
                            <th width="258">{$Think.lang.action}</th>
                        </tr>
                        {volist name="dataList" id="vo"}
                        <tr>
                            <td>{$vo.id}</td>
                            <td>{$vo.headline}</td>
                            <td>{$vo.ArctypeMod->title}</td>
                            <td>{$vo.content}</td>
                            <td><img src="{$vo.pic}" width="50px" height="60px"></td>
                            <td>{$vo.production}</td>
                            <td>{$vo.link}</td>
                            <td>
                                <a href="javascript:void(0);" data-id="{$vo.id}" data-field="status"
                                   data-value="{$vo.status}" data-url="{:url('edit', 'id='.$vo['id'])}"
                                   class='editimg fa {if condition=" $vo.status == 1 "}fa-check-circle text-green{else /}fa-times-circle text-red{/if}'></a>
                            </td>
                            <td>{$vo.sorts}</td>
                            <td><a href="javascript:void(0);" data-id="{$vo.id}" data-field="zxm"
                                   data-value="{$vo.zxm}" data-url="{:url('edit', 'id='.$vo['id'])}"
                                   class='editimg fa {if condition=" $vo.zxm == 1 "}fa-check-circle text-green{else /}fa-times-circle text-red{/if}'></a></td>
                            <td>{$vo.create_time}</td>
                            <td>{$vo.update_time}</td>
                            <td>

                                {if condition=" $vo.mid == 20 || $vo.mid == 22 "}

                                {else /}

                                {/if}
                                {include file="public/list_action" /}
                            </td>
                        </tr>
                        {/volist}
                    </table>
                </div>
                <div class="box-footer clearfix">
                    {$dataList->render()}
                </div>
            </div>
        </div>
    </div>
</section>
<script type="text/javascript">
    $(function(){
        $('.editable').editable({
            emptytext: "empty",
            params: function(params) {      //参数
                var data = {};
                data['id'] = params.pk;
                data[params.name] = params.value;
                return data;
            },
            success: function(response, newValue) {
                var res = $.parseJSON( response );
                if(res.status == 1){
                }else{
                    return res.info;
                }
            }
        });

        {if condition=" $rest_login == 1 "}
        restlogin('{$rest_login_info}');   //登录超时
        {/if}
        })
</script>
{/block}